home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK1.toast / Development Kits / Mac OS / UPDATE- Int&Libs 3.2 / CIncludes / Folders.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-25  |  12.6 KB  |  333 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Folders.h
  3.  
  4.      Contains:    Folder Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    Veronica Seed, Use with 3.2 Universal Interfaces
  8.  
  9.      Copyright:    © 1995-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __FOLDERS__
  18. #define __FOLDERS__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23.  
  24.  
  25.  
  26. #if PRAGMA_ONCE
  27. #pragma once
  28. #endif
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37.  
  38. #if PRAGMA_STRUCT_ALIGN
  39.     #pragma options align=mac68k
  40. #elif PRAGMA_STRUCT_PACKPUSH
  41.     #pragma pack(push, 2)
  42. #elif PRAGMA_STRUCT_PACK
  43.     #pragma pack(2)
  44. #endif
  45.  
  46. enum {
  47.     kOnSystemDisk                = -32768L                        /* previously was 0x8000 but that is an unsigned value whereas vRefNum is signed*/
  48. };
  49.  
  50. enum {
  51.     kCreateFolder                = true,
  52.     kDontCreateFolder            = false
  53. };
  54.  
  55. enum {
  56.     kSystemFolderType            = FOUR_CHAR_CODE('macs'),        /* the system folder */
  57.     kDesktopFolderType            = FOUR_CHAR_CODE('desk'),        /* the desktop folder; objects in this folder show on the desk top. */
  58.     kTrashFolderType            = FOUR_CHAR_CODE('trsh'),        /* the trash folder; objects in this folder show up in the trash */
  59.     kWhereToEmptyTrashFolderType = FOUR_CHAR_CODE('empt'),        /* the "empty trash" folder; Finder starts empty from here down */
  60.     kPrintMonitorDocsFolderType    = FOUR_CHAR_CODE('prnt'),        /* Print Monitor documents */
  61.     kStartupFolderType            = FOUR_CHAR_CODE('strt'),        /* Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here */
  62.     kShutdownFolderType            = FOUR_CHAR_CODE('shdf'),        /* Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here */
  63.     kAppleMenuFolderType        = FOUR_CHAR_CODE('amnu'),        /* Finder objects to put into the Apple menu go here */
  64.     kControlPanelFolderType        = FOUR_CHAR_CODE('ctrl'),        /* Control Panels go here (may contain INITs) */
  65.     kExtensionFolderType        = FOUR_CHAR_CODE('extn'),        /* System extensions go here */
  66.     kFontsFolderType            = FOUR_CHAR_CODE('font'),        /* Fonts go here */
  67.     kPreferencesFolderType        = FOUR_CHAR_CODE('pref'),        /* preferences for applications go here */
  68.     kTemporaryFolderType        = FOUR_CHAR_CODE('temp')        /* temporary files go here (deleted periodically, but don't rely on it.) */
  69. };
  70.  
  71. /*
  72.     Note:     The FindFolder trap was not implemented until System 7.  If you want to call FindFolder
  73.             while running on System 6 machines, then define USE_FINDFOLDER_GLUE and link with
  74.             Interface.o which contains glue to implement FindFolder on pre-System 7 machines.
  75. */
  76. #ifdef USE_FINDFOLDER_GLUE
  77. EXTERN_API( OSErr )
  78. FindFolder                        (short                     vRefNum,
  79.                                  OSType                 folderType,
  80.                                  Boolean                 createFolder,
  81.                                  short *                foundVRefNum,
  82.                                  long *                    foundDirID);
  83.  
  84. #else
  85. EXTERN_API( OSErr )
  86. FindFolder                        (short                     vRefNum,
  87.                                  OSType                 folderType,
  88.                                  Boolean                 createFolder,
  89.                                  short *                foundVRefNum,
  90.                                  long *                    foundDirID)                            TWOWORDINLINE(0x7000, 0xA823);
  91.  
  92. #endif  /* defined(USE_FINDFOLDER_GLUE) */
  93.  
  94. EXTERN_API( OSErr )
  95. ReleaseFolder                    (short                     vRefNum,
  96.                                  OSType                 folderType)                            TWOWORDINLINE(0x700B, 0xA823);
  97.  
  98.  
  99. #if (forCarbon || TARGET_OS_UNIX || TARGET_OS_WIN32)
  100. /* Since non-mac targets don't know about VRef's or DirID's, the Ex version returns
  101.    the found folder path.
  102.  */
  103. EXTERN_API_C( OSErr )
  104. FindFolderEx                    (short                     vRefNum,
  105.                                  OSType                 folderType,
  106.                                  Boolean                 createFolder,
  107.                                  short *                foundVRefNum,
  108.                                  long *                    foundDirID,
  109.                                  char *                    foundFolder);
  110.  
  111. #endif  /* (forCarbon || TARGET_OS_UNIX || TARGET_OS_WIN32) */
  112.  
  113. /******************************************/
  114. /* Extensible Folder Manager declarations */
  115. /******************************************/
  116.  
  117. /****************************/
  118. /* Folder Manager constants */
  119. /****************************/
  120.  
  121. enum {
  122.     kExtensionDisabledFolderType = FOUR_CHAR_CODE('extD'),
  123.     kControlPanelDisabledFolderType = FOUR_CHAR_CODE('ctrD'),
  124.     kSystemExtensionDisabledFolderType = FOUR_CHAR_CODE('macD'),
  125.     kStartupItemsDisabledFolderType = FOUR_CHAR_CODE('strD'),
  126.     kShutdownItemsDisabledFolderType = FOUR_CHAR_CODE('shdD'),
  127.     kApplicationsFolderType        = FOUR_CHAR_CODE('apps'),
  128.     kDocumentsFolderType        = FOUR_CHAR_CODE('docs')
  129. };
  130.  
  131. enum {
  132.                                                                 /* new constants */
  133.     kVolumeRootFolderType        = FOUR_CHAR_CODE('root'),        /* root folder of a volume */
  134.     kChewableItemsFolderType    = FOUR_CHAR_CODE('flnt'),        /* items deleted at boot */
  135.     kApplicationSupportFolderType = FOUR_CHAR_CODE('asup'),        /* third-party items and folders */
  136.     kTextEncodingsFolderType    = FOUR_CHAR_CODE('ƒtex'),        /* encoding tables */
  137.     kStationeryFolderType        = FOUR_CHAR_CODE('odst'),        /* stationery */
  138.     kOpenDocFolderType            = FOUR_CHAR_CODE('odod'),        /* OpenDoc root */
  139.     kOpenDocShellPlugInsFolderType = FOUR_CHAR_CODE('odsp'),    /* OpenDoc Shell Plug-Ins in OpenDoc folder */
  140.     kEditorsFolderType            = FOUR_CHAR_CODE('oded'),        /* OpenDoc editors in MacOS Folder */
  141.     kOpenDocEditorsFolderType    = FOUR_CHAR_CODE('ƒodf'),        /* OpenDoc subfolder of Editors folder */
  142.     kOpenDocLibrariesFolderType    = FOUR_CHAR_CODE('odlb'),        /* OpenDoc libraries folder */
  143.     kGenEditorsFolderType        = FOUR_CHAR_CODE('ƒedi'),        /* CKH general editors folder at root level of Sys folder */
  144.     kHelpFolderType                = FOUR_CHAR_CODE('ƒhlp'),        /* CKH help folder currently at root of system folder */
  145.     kInternetPlugInFolderType    = FOUR_CHAR_CODE('ƒnet'),        /* CKH internet plug ins for browsers and stuff */
  146.     kModemScriptsFolderType        = FOUR_CHAR_CODE('ƒmod'),        /* CKH modem scripts, get 'em OUT of the Extensions folder */
  147.     kPrinterDescriptionFolderType = FOUR_CHAR_CODE('ppdf'),        /* CKH new folder at root of System folder for printer descs. */
  148.     kPrinterDriverFolderType    = FOUR_CHAR_CODE('ƒprd'),        /* CKH new folder at root of System folder for printer drivers */
  149.     kScriptingAdditionsFolderType = FOUR_CHAR_CODE('ƒscr'),        /* CKH at root of system folder */
  150.     kSharedLibrariesFolderType    = FOUR_CHAR_CODE('ƒlib'),        /* CKH for general shared libs. */
  151.     kVoicesFolderType            = FOUR_CHAR_CODE('fvoc'),        /* CKH macintalk can live here */
  152.     kControlStripModulesFolderType = FOUR_CHAR_CODE('sdev'),    /* CKH for control strip modules */
  153.     kAssistantsFolderType        = FOUR_CHAR_CODE('astƒ'),        /* SJF for Assistants (MacOS Setup Assistant, etc) */
  154.     kUtilitiesFolderType        = FOUR_CHAR_CODE('utiƒ'),        /* SJF for Utilities folder */
  155.     kAppleExtrasFolderType        = FOUR_CHAR_CODE('aexƒ'),        /* SJF for Apple Extras folder */
  156.     kContextualMenuItemsFolderType = FOUR_CHAR_CODE('cmnu'),    /* SJF for Contextual Menu items */
  157.     kMacOSReadMesFolderType        = FOUR_CHAR_CODE('morƒ'),        /* SJF for MacOS ReadMes folder */
  158.     kALMModulesFolderType        = FOUR_CHAR_CODE('walk'),        /* EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType) */
  159.     kALMPreferencesFolderType    = FOUR_CHAR_CODE('trip'),        /* EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType) */
  160.     kALMLocationsFolderType        = FOUR_CHAR_CODE('fall'),        /* EAS for Location Manager Locations (within kALMPreferencesFolderType) */
  161.     kColorSyncProfilesFolderType = FOUR_CHAR_CODE('prof'),        /* for ColorSync™ Profiles */
  162.     kThemesFolderType            = FOUR_CHAR_CODE('thme'),        /* for Theme data files */
  163.     kFavoritesFolderType        = FOUR_CHAR_CODE('favs'),        /* Favorties folder for Navigation Services */
  164.     kInternetFolderType            = FOUR_CHAR_CODE('intƒ'),        /* Internet folder (root level of startup volume) */
  165.     kAppearanceFolderType        = FOUR_CHAR_CODE('appr'),        /* Appearance folder (root of system folder) */
  166.     kSoundSetsFolderType        = FOUR_CHAR_CODE('snds'),        /* Sound Sets folder (in Appearance folder) */
  167.     kDesktopPicturesFolderType    = FOUR_CHAR_CODE('dtpƒ'),        /* Desktop Pictures folder (in Appearance folder) */
  168.     kInternetSearchSitesFolderType = FOUR_CHAR_CODE('issf'),    /* Internet Search Sites folder */
  169.     kFindSupportFolderType        = FOUR_CHAR_CODE('fnds'),        /* Find support folder */
  170.     kFindByContentFolderType    = FOUR_CHAR_CODE('fbcf'),        /* Find by content folder */
  171.     kInstallerLogsFolderType    = FOUR_CHAR_CODE('ilgf'),        /* Installer Logs folder */
  172.     kScriptsFolderType            = FOUR_CHAR_CODE('scrƒ'),        /* Scripts folder */
  173.     kFolderActionsFolderType    = FOUR_CHAR_CODE('fasf'),        /* Folder Actions Scripts folder */
  174.     kLauncherItemsFolderType    = FOUR_CHAR_CODE('laun'),        /* Launcher Items folder */
  175.     kRecentApplicationsFolderType = FOUR_CHAR_CODE('rapp'),        /* Recent Applications folder */
  176.     kRecentDocumentsFolderType    = FOUR_CHAR_CODE('rdoc'),        /* Recent Documents folder */
  177.     kRecentServersFolderType    = FOUR_CHAR_CODE('rsvr'),        /* Recent Servers folder */
  178.     kSpeakableItemsFolderType    = FOUR_CHAR_CODE('spki'),        /* Speakable Items folder */
  179.     kKeychainFolderType            = FOUR_CHAR_CODE('kchn'),        /* Keychain folder */
  180.     kQuickTimeExtensionsFolderType = FOUR_CHAR_CODE('qtex')        /* QuickTime Extensions Folder (in Extensions folder) */
  181. };
  182.  
  183. enum {
  184.     kLocalesFolderType            = FOUR_CHAR_CODE('ƒloc'),        /* PKE for Locales folder */
  185.     kFindByContentPluginsFolderType = FOUR_CHAR_CODE('fbcp')    /* Find By Content Plug-ins */
  186. };
  187.  
  188. /* FolderDescFlags values */
  189. enum {
  190.     kCreateFolderAtBoot            = 0x00000002,
  191.     kFolderCreatedInvisible        = 0x00000004,
  192.     kFolderCreatedNameLocked    = 0x00000008
  193. };
  194.  
  195. typedef UInt32                             FolderDescFlags;
  196. /* FolderClass values */
  197. enum {
  198.     kRelativeFolder                = FOUR_CHAR_CODE('relf'),
  199.     kSpecialFolder                = FOUR_CHAR_CODE('spcf')
  200. };
  201.  
  202. typedef OSType                             FolderClass;
  203. /* special folder locations */
  204. enum {
  205.     kBlessedFolder                = FOUR_CHAR_CODE('blsf'),
  206.     kRootFolder                    = FOUR_CHAR_CODE('rotf')
  207. };
  208.  
  209. typedef OSType                             FolderType;
  210. typedef OSType                             FolderLocation;
  211.  
  212.  
  213. struct FolderDesc {
  214.     Size                             descSize;
  215.     FolderType                         foldType;
  216.     FolderDescFlags                 flags;
  217.     FolderClass                     foldClass;
  218.     FolderType                         foldLocation;
  219.     OSType                             badgeSignature;
  220.     OSType                             badgeType;
  221.     UInt32                             reserved;
  222.     StrFileName                     name;                        /* Str63 on MacOS*/
  223. };
  224. typedef struct FolderDesc                FolderDesc;
  225. typedef FolderDesc *                    FolderDescPtr;
  226.  
  227.  
  228. typedef UInt32                             RoutingFlags;
  229.  
  230. struct FolderRouting {
  231.     Size                             descSize;
  232.     OSType                             fileType;
  233.     FolderType                         routeFromFolder;
  234.     FolderType                         routeToFolder;
  235.     RoutingFlags                     flags;
  236. };
  237. typedef struct FolderRouting            FolderRouting;
  238. typedef FolderRouting *                    FolderRoutingPtr;
  239. /* routing constants */
  240. /***************************/
  241. /* Folder Manager routines */
  242. /***************************/
  243. /* Folder Manager administration routines */
  244. EXTERN_API( OSErr )
  245. AddFolderDescriptor                (FolderType             foldType,
  246.                                  FolderDescFlags         flags,
  247.                                  FolderClass             foldClass,
  248.                                  FolderLocation         foldLocation,
  249.                                  OSType                 badgeSignature,
  250.                                  OSType                 badgeType,
  251.                                  ConstStrFileNameParam     name,
  252.                                  Boolean                 replaceFlag)                        TWOWORDINLINE(0x7020, 0xA823);
  253.  
  254. EXTERN_API( OSErr )
  255. GetFolderDescriptor                (FolderType             foldType,
  256.                                  Size                     descSize,
  257.                                  FolderDesc *            foldDesc)                            TWOWORDINLINE(0x7023, 0xA823);
  258.  
  259. EXTERN_API( OSErr )
  260. GetFolderTypes                    (UInt32                 requestedTypeCount,
  261.                                  UInt32 *                totalTypeCount,
  262.                                  FolderType *            theTypes)                            TWOWORDINLINE(0x7024, 0xA823);
  263.  
  264. EXTERN_API( OSErr )
  265. RemoveFolderDescriptor            (FolderType             foldType)                            TWOWORDINLINE(0x7021, 0xA823);
  266.  
  267. /* legacy routines */
  268. EXTERN_API( OSErr )
  269. GetFolderName                    (short                     vRefNum,
  270.                                  OSType                 foldType,
  271.                                  short *                foundVRefNum,
  272.                                  StrFileName             name)                                TWOWORDINLINE(0x700E, 0xA823);
  273.  
  274. /* routing routines */
  275. EXTERN_API( OSErr )
  276. AddFolderRouting                (OSType                 fileType,
  277.                                  FolderType             routeFromFolder,
  278.                                  FolderType             routeToFolder,
  279.                                  RoutingFlags             flags,
  280.                                  Boolean                 replaceFlag)                        TWOWORDINLINE(0x7026, 0xA823);
  281.  
  282. EXTERN_API( OSErr )
  283. RemoveFolderRouting                (OSType                 fileType,
  284.                                  FolderType             routeFromFolder)                    TWOWORDINLINE(0x7027, 0xA823);
  285.  
  286. EXTERN_API( OSErr )
  287. FindFolderRouting                (OSType                 fileType,
  288.                                  FolderType             routeFromFolder,
  289.                                  FolderType *            routeToFolder,
  290.                                  RoutingFlags *            flags)                                TWOWORDINLINE(0x7022, 0xA823);
  291.  
  292. EXTERN_API( OSErr )
  293. GetFolderRoutings                (UInt32                 requestedRoutingCount,
  294.                                  UInt32 *                totalRoutingCount,
  295.                                  Size                     routingSize,
  296.                                  FolderRouting *        theRoutings)                        TWOWORDINLINE(0x701E, 0xA823);
  297.  
  298. EXTERN_API( OSErr )
  299. InvalidateFolderDescriptorCache    (short                     vRefNum,
  300.                                  long                     dirID)                                TWOWORDINLINE(0x7025, 0xA823);
  301.  
  302. EXTERN_API( OSErr )
  303. IdentifyFolder                    (short                     vRefNum,
  304.                                  long                     dirID,
  305.                                  FolderType *            foldType)                            TWOWORDINLINE(0x701F, 0xA823);
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313. #if PRAGMA_STRUCT_ALIGN
  314.     #pragma options align=reset
  315. #elif PRAGMA_STRUCT_PACKPUSH
  316.     #pragma pack(pop)
  317. #elif PRAGMA_STRUCT_PACK
  318.     #pragma pack()
  319. #endif
  320.  
  321. #ifdef PRAGMA_IMPORT_OFF
  322. #pragma import off
  323. #elif PRAGMA_IMPORT
  324. #pragma import reset
  325. #endif
  326.  
  327. #ifdef __cplusplus
  328. }
  329. #endif
  330.  
  331. #endif /* __FOLDERS__ */
  332.  
  333.